package com.poly_;

/**
 * Enjoy programming!!!
 * Time: 2021/12/14 -  17:08
 */
public class Dynamic {
    public static void main(String[] args) {
     A a = new B();
        System.out.println(a.getI());
        System.out.println(a.sum());
    }
}
class A {
    private int i = 10;
    public int getI(){
        return i;
    }
    public int sum(){
        return i + 10;
    }
    public int sum1(){
       return i + 20;
    }
}
class B extends A{
    private int i = 20;

    public int getI(){
        return i;
    }

    public int sum(){
        return i + 50;
    }
}
